/** 
 * 项目名称:Sprider-WebMagic-bak 
 * 文件名称:MaoYanSearchMoviePipeline.java 
 * 包名:com.xiaotu.spider.maoyan.pipeline 
 * 创建日期:2020年1月2日上午10:26:40 
 * Copyright (c) 2020, zxaiye1314@163.com All Rights Reserved.</pre> 
 */  
package com.xiaotu.spider.maoyan.pipeline;

import org.springframework.stereotype.Component;
import com.xiaotu.common.model.MaoYanSearchMovieModel;
import com.xiaotu.common.util.Constants;
import com.xiaotu.common.util.DataRedisKeyUtils;
import com.xiaotu.spider.APipeline;
import us.codecraft.webmagic.ResultItems;
import us.codecraft.webmagic.Task;

/**
 * 
 * 项目名称：Sprider-WebMagic    
 * 类名称：MaoYanSearchMovieSupplementPipeline    
 * 类描述：    
 * 创建人：张晓   
 * 创建时间：2020年1月8日 下午5:51:03    
 * @version
 */
@Component("MaoYanSearchMovieSupplementPipeline")
public class MaoYanSearchMovieSupplementPipeline extends APipeline {
	
	@Override
	protected void doProcess(ResultItems resultItems, Task task) {
		
		MaoYanSearchMovieModel obj = resultItems.get(MaoYanSearchMovieModel.class.getName());
        if(null!=obj){
        	//String key = DataRedisKeyUtils.getKey(Constants.DataRedisKey.MAOYAN_SEARCH_MOVIE_YYYYMMDD);
        	String key = "MAOYAN_SEARCH_MOVIE_SUPPLEMENT_20200114";
        	cacheHandler.hSet(key, obj.getId()+"_"+obj.getTvname(), obj);
        	//cacheHandler.setCacheTimeout(key);
        }
        
	}
	
}
